import Vue from "vue";
import VueRouter from "vue-router";
import indexView from "@/views/index.vue";
import gameCircle from "@/views/game_circle.vue";
import detail from "@/views/game_detail.vue";
import searchView from "@/views/search.vue";
import gameInfoView from "@/views/gameInfo.vue";
Vue.use(VueRouter);

const router = new VueRouter({
  mode: "history",
  routes: [
    {
      path: "/index",
      component: indexView,
    },
    {
      path: "/gameInfo/:id",
      component: gameInfoView,
    },
    {
      path: "/circle",
      component: gameCircle,
    },
    {
      path: "/detail/:id",
      component: detail,
    },
    { path: "/search", component: searchView },
    {
      path: "*",
      redirect: "/index",
    },
  ],
});

export default router;
